<template>
<div class="wrapper">
  <ul class="business">
    <li v-for="item in businessList"
        :key="item.businessId"
        @click="toBusinessList"
    >
      <img :src="item.imgUrl">
      <div class="business-info">
        <div class="business-info-h">
          <h3>{{item.name}}</h3>
          <div class="business-info-like">&#8226;</div>
        </div>
        <div class="business-info-star">
          <div class="business-info-star-left">
            <i class="fa fa-star"></i>
            <i class="fa fa-star"></i>
            <i class="fa fa-star"></i>
            <i class="fa fa-star"></i>
            <i class="fa fa-star"></i>
            <p></p>
          </div>
          <div class="business-info-star-right">
            送货
          </div>
        </div>
        <div class="business-info-delivery">
          <p>&#165;{{ item.startPrice }} | &#165;{{ item.deliveryPrice }}</p>
          <p>{{ 30 }}km | {{ 30 }}分钟</p>
        </div>
        <div class="business-info-explain">
          <div>{{ item.description }}</div>
        </div>
        <div class="business-info-promotion">
          <div class="business-info-promotion-left">
            <div class="business-info-promotion-left-incon">新</div>
            <p>{{ 300}}</p>
          </div>
          <div class="business-info-promotion-right">
            <p>{{ item.remarks }}</p>
            <i class="fa fa-caret-down"></i>
          </div>
        </div>
        <div class="business-info-promotion">
          <div class="business-info-promotion-left">
            <div class="business-info-promotion-left-incon"
                 style="background-color: #F1884F;">特</div>
<!--            <p>{{ item.price }}</p>-->
          </div>
        </div>
      </div>
    </li>
  </ul>
</div>
</template>

<script setup>
import router from "@/router";
import {onMounted, ref} from "vue";
import {getAllShops} from "@/utils/api/ShopManager";
onMounted(()=>{
  getData()
})
let businessList = ref([])
async function getData(){
  await getAllShops().then((res)=>{
    if(res.flag) {
      businessList.value = res.data
    }
  })
}

function toBusinessList(){
  router.push({path:'/BusinessListPart'})
}
</script>

<style scoped>
.business {
  width: 100%;
  margin-bottom: 14vw;
}
ul {
  padding-inline-start: 0;
  padding-bottom: 90px;
}
.business li {
  width: 100%;
  box-sizing: border-box;
  padding: 2.5vw;
  user-select: none;
  border-bottom: solid 1px #DDD;
  display: flex;
}
.business li img {
  width: 18vw;
  height: 18vw;
}
.business li .business-info {
  width: 100%;
  box-sizing: border-box;
  padding-left: 3vw;
}
.business li .business-info .business-info-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2vw;
}
.business li .business-info .business-info-h h3 {
  font-size: 4vw;
  color: #333;
}
.business li .business-info .business-info-h .business-info-like{
  width: 1.6vw;
  height: 3.4vw;
  background-color: #666;
  color: #fff;
  font-size: 4vw;
  margin-right: 4vw;

  display: flex;
  justify-content: center;
  align-items: center; }
.business li .business-info .business-info-star{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2vw;
  font-size: 3.1vw; }
.business li .business-info .business-info-star .business-info-star-left{
  display: flex;
  align-items: center; }
.business li .business-info .business-info-star .business-info-star-left .fa-star{
  color: #FEC80E;
  margin-right: 0.5vw; }
.business li .business-info .business-info-star .business-info-star-left p{
  color: #666;
  margin-left: 1vw; }
.business li .business-info .business-info-star .business-info-star-right{
  background-color: #0097FF;
  color: #fff;
  font-size: 2.4vw;
  border-radius: 2px;
  padding: 0 0.6vw; }
.business li .business-info .business-info-delivery{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2vw;

  color: #666;
  font-size: 3.1vw; }
.business li .business-info .business-info-explain{
  display: flex;
  align-items: center;
  margin-bottom: 3vw; }
.business li .business-info .business-info-explain div{
  border: solid 1px #DDD;
  font-size: 2.8vw;
  color: #666;
  border-radius: 3px;
  padding: 0 0.1vw ;
}
.business li .business-info .business-info-promotion{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.8vw; }
.business li .business-info .business-info-promotion .business-info-promotion-left{
  display: flex;
  align-items: center; }
.business li .business-info .business-info-promotion .business-info-promotion-left
.business-info-promotion-left-incon{
  width: 4vw;
  height: 4vw;
  background-color: #70BC46;
  border-radius: 3px;
  font-size: 3vw;
  color: #fff;

  display: flex;
  justify-content: center;
  align-items: center; }
.business li .business-info .business-info-promotion .business-info-promotion-left p{
  color: #666;
  font-size: 3vw;
  margin-left: 2vw; }
.business li .business-info .business-info-promotion .business-info-promotion-right{
  display: flex;
  align-items: center;
  font-size: 2.5vw;
  color: #999; }
.business li .business-info .business-info-promotion .business-info-promotion-right p{
  margin-right: 2vw; }
</style>